/*
 *  Queen Mary University of London MOM System
 *  
 *  Copyright Queen Mary University of London
 *  
 *  Authors:
 *  Bob Chew (bob.chew@elec.qmul.ac.uk)
 *  Beatriz Viñal Murciano (beavimu@gmail.com)
 *  John Bigham (john.bigham@elec.qmul.ac.uk)
 *  
 *  
 *  Portions of this software uses Apache Qpid
 *    http://qpid.apache.org
 *  
 *  Apache Qpid license:
 * --------------------------------------------------------------
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 * -------------------------------------------------------------
 * 
 */
package users;

/**
 * Subscription to a topic.
 */
public class Subscription {

    /** Unique ID of the subscription. */
    private String id;
    /** Name of the topic of the subscription. */
    private String topic;
    /** Message selector of the subscription. */
    private String msgSelector;

    /**
     * Getter for the variable 'id'.
     * @return variable 'id'
     */
    public String getId() {
        return id;
    }
    /**
     * Setter for the variable 'id'.
     * @param id  new value of the variable 'id'
     */
    protected void setId(final String id) {
        this.id = id;
    }
    /**
     * Getter for the variable 'topic'.
     * @return variable 'topic'
     */
    public String getTopic() {
        return topic;
    }
    /**
     * Setter for the variable 'topic'.
     * @param topic  new value of the variable 'topic'
     */
    public void setTopic(final String topic) {
        this.topic = topic;
    }
    /**
     * Getter for the variable 'msgSelector'.
     * @return variable 'msgSelector'
     */
    public String getMsgSelector() {
        return msgSelector;
    }
    /**
     * Setter for the variable 'msgSelector'.
     * @param msgSelector  new value of the variable 'msgSelector'
     */
    public void setMsgSelector(final String msgSelector) {
        this.msgSelector = msgSelector;
    }


    /**
     * Constructor without parameters.
     */
    public Subscription() { }

    /**
     * Constructor.
     *
     * @param subscriptionId  unique ID of the subscription
     * @param topic  topic of the subscription
     * @param msgSelector  message selector of the subscription
     */
    public Subscription(final String subscriptionId, final String topic,
                        final String msgSelector) {

        this.id = subscriptionId;
        this.topic = topic;
        this.msgSelector = msgSelector;

    }

}
